package javaCode.chapter07.Homework.homework05;


//3、科学家除基本工资外，还有年终奖 bonus
public class Scientist extends Employee {
    private double bonus;

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    public Scientist(String name, double sal) {
        super(name, sal);
    }

    //因为和父类不同，需要重新写
    @Override
    public void yearSal() {
        System.out.println("科学家" + super.getName() + " 年薪=" + (super.getSalMonth() * super.getSal() + bonus));
    }
}
